<!DOCTYPE html>
<html lang="zh-CN">

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
		<title>修改密码</title>
		<meta name="keywords" content="">
		<meta name="description" content="">
		<script src="../js/rem.js"></script>
		<script src="../js/jquery.min.js" type="text/javascript"></script>
		<link rel="stylesheet" type="text/css" href="../css/base.css" />
		<link rel="stylesheet" type="text/css" href="../css/page.css" />
		<link rel="stylesheet" type="text/css" href="../css/all.css" />
		<link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
		<link rel="stylesheet" type="text/css" href="../css/loaders.min.css" />
		<link rel="stylesheet" type="text/css" href="../css/loading.css" />
		<script type="text/javascript">
			$(window).load(function() {
				$(".loading").addClass("loader-chanage")
				$(".loading").fadeOut(300)
			})
		</script>
	</head>
	<!--loading页开始-->
	<div class="loading">
		<div class="loader">
			<div class="loader-inner pacman">
				<div></div>
				<div></div>
				<div></div>
				<div></div>
				<div></div>
			</div>
		</div>
	</div>
	<!--loading页结束-->

	<body>
		<header class="mui-bar mui-bar-nav report-header box-s" id="header">
			<a href="javascript:history.go(-1)"><i class="iconfont icon-fanhui fl"></i></a>
			<p>修改密码</p>
		</header>
		<div id="main" class="mui-clearfix">
			<div class="mpsw clearfloat box-s">
				<form action="" method="post">
					<input type="password" name="" id="oldPwd" value="" placeholder="请输入原密码" />
					<input type="password" name="" id="newPwd" value="" placeholder="请输入新密码" />
					<input type="password" name="" id="confirmPwd" value="" placeholder="请再次输入新密码" />
				</form>
			</div>
			<div class="psw-btn clearfloat">
				<a onclick="updatePwd()" class="fl">修改密码</a>
				<a href="#" class="fr">取消修改</a>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../js/jquery-1.8.3.min.js"></script>
	<script src="../js/fastclick.js"></script>
	<script src="../js/mui.min.js"></script>
	<script type="text/javascript" src="../js/hmt.js"></script>

	<!--注意这个3个js的导入顺序-->
	<script type="text/javascript" src="../js/common/const.js"></script>
	<script src="../js/service/request.js"></script>
	<script src="../js/service/user_service.js"></script>

	<script>
		function updatePwd() {
			var oldPwd = $("#oldPwd").val();
			var newPwd = $("#newPwd").val();
			var confirmPwd = $("#confirmPwd").val();
			if(newPwd == "" || newPwd != confirmPwd) {

				mui.toast("两次输入密码不一致", {
					duration: 'long',
					type: 'div'
				})
				return false;
			}
			var res = update_password(oldPwd, newPwd);

			mui.toast(res.msg, {
				duration: 'long',
				type: 'div'
			})
			if(res.resultCode == REQUEST_SUCCESS_CDOE) {
				setTimeout(() => {
					//关闭当前窗口
					mui.back();
				}, 2000);
			}
		}
	</script>

</html>